<?php
$view = '<div id="viewpost">  <div id="xeco"><div style="text-align:center; width:100%; margin-bottom:15px;"><img src="images/title1.gif" alt="" /><span style="color:#3f0102; font-size:26px"> &nbsp; <strong>Video</strong> &nbsp; </span><img src="images/title2.gif" alt="" /></div></div>';
if(@$_GET['detail']){
	$dt = $_GET['detail'];
	$id_video = $tc->id_video($dt);
	$str = "SELECT name,link_video FROM video WHERE `delete`=0 AND status=1 AND id='{$id_video}'";
}else $str = "SELECT name,link_video FROM video WHERE `delete`=0 AND status=1 ORDER BY date_update DESC LIMIT 1";
$qr = mysql_query($str);
$row = mysql_fetch_array($qr);
$view .= '<h1>'.$row['name'].'</h1><div style="width:100%; clear:both; margin:20px 0"><iframe width="600px" height="500px" style="margin-left:190px" src="'.$row['link_video'].'?origin=www.hongcuongclub.com&rel=0" frameborder="0"></iframe></div>';

$from = (($page - 1) * max_video);
$select = 'id,name,name_rewrite,url_hinh,link_video,description,menu_id';
$table = 'video';
$where = "`delete`=0 AND status=1 AND id<>'{$id_video}' AND menu_id LIKE '%,{$idMenu},%'";
$limit = "LIMIT {$from},".max_video;

$view .= '<div id="listinfo">';
$qr = $tc->list_item($select,$table,$where,$limit);
while($row = mysql_fetch_array($qr)){
	$url_link = $tc->link_detail($row['menu_id']);
	($row['url_hinh']!= '') ? $url_hinh = url_hinh_video_thumbs.$row['url_hinh'] : $url_hinh='upload/no-image.jpg';
	$view .= "<div class=\"item\">
		<a href=\"{$url_link}{$row['name_rewrite']}.html\"><img src=\"{$url_hinh}\" alt=\"{$row['name']}\" />
		<h2>{$row['name']}</h2></a>
		<p>{$row['description']}</p>
		<div style=\"height:10px; clear:both\"></div>
	</div>";
}
mysql_free_result($qr);
//$phantrang = $tc->phantrang($menu['url'],$page,max_video,'id',$table,$where);
//$view .= "</div><div id=\"phantrang\">{$phantrang}</div>";
//$navigator = '<div id="xeco"><div style="text-align:center; width:100%; margin-bottom:15px;"><h1 style="font-size:26px; color:#3f0102"><img src="images/title1.gif" alt="" /> &nbsp; '.$menu['name'].' &nbsp; <img src="images/title2.gif" alt="" /></h1></div></div>';
//$view = $navigator.$view;
echo $view.'</div></div>';
